# 清理现有资源
echo " 清理现有资源..."
kubectl delete deployment k8s-demo-app -n k8s-demo
kubectl delete service k8s-demo-service -n k8s-demo
kubectl delete hpa k8s-demo-hpa -n k8s-demo
kubectl delete namespace k8s-demo

echo " 删除集群..."
kind delete cluster --name k8s-demo 2>/dev/null || true

# 删除本地构建的 Docker 镜像
echo "删除本地构建的 Docker 镜像..."
podman rmi localhost/k8s-demo-app:0.0.1 || true
echo "清理完成!"
